package com.wiim.model;

import java.io.Serializable;
import java.text.DecimalFormat;
import java.text.NumberFormat;

import android.text.TextUtils;

public class UserData extends DataContract implements Serializable {

	private static final long serialVersionUID = 6429412477540096118L;

	public String UserId;

	public String Username;

	public String Password;

	public String Fullname;

	public String DeviceID;

	public String LastLogin;

	public String CreatedDate;

	public String AccountType;

	public String ValidateUserResponse;

	public String RewardAmount;

	public String Status;

	// Save data to SharedMgr in ALTAppMgr
	public void save() {
	}

	public void load() {
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("User Id: " + this.getUserId() + "\n");
		sb.append("User Name: " + this.getUsername() + "\n");
		return sb.toString();
	}

	public String getUserId() {
		return UserId;
	}

	public void setUserId(String userId) {
		UserId = userId;
	}

	public String getUsername() {
		return Username;
	}

	public void setUsername(String username) {
		Username = username;
	}

	public String getPassword() {
		return Password;
	}

	public void setPassword(String password) {
		Password = password;
	}

	public String getDeviceID() {
		return DeviceID;
	}

	public void setDeviceID(String deviceID) {
		DeviceID = deviceID;
	}

	public String getLastLogin() {
		return LastLogin;
	}

	public void setLastLogin(String lastLogin) {
		LastLogin = lastLogin;
	}

	public String getAccountType() {
		return AccountType;
	}

	public void setAccountType(String accountType) {
		AccountType = accountType;
	}

	public String getValidateUserResponse() {
		return ValidateUserResponse;
	}

	public void setValidateUserResponse(String validateUserResponse) {
		ValidateUserResponse = validateUserResponse;
	}

	public String getRewardPoints() {
		if (TextUtils.isEmpty(RewardAmount)) {
			return "0";
		} else {
			NumberFormat formatter = new DecimalFormat("#,###,###");
			return formatter.format(Double.parseDouble(RewardAmount)).replace(",", ".");
		}

	}

}
